<template>
    <div>
        父组件
        <child :persons="persons">
            <!-- <template :style="{color:scope.row.age > 18 ? 'red':'green'}" slot-scope="scope">
                {{scope.row.name}} --- {{scope.row.age}}
            </template> -->
            <div :style="{color:scope.row.age > 18 ? 'red':'green'}" slot-scope="scope">
                {{scope.row.name}} --- {{scope.row.age}}
            </div>
        </child>
    </div>
</template>

<script>
import Child from './Child'
export default {
    components:{
        Child
    },
    data(){
        return {
            persons:[
                {id:1,name:'张三',age:16},
                {id:2,name:'李四',age:20},
                {id:3,name:'小王',age:15}
            ]
        }
    }
}
</script>
